package com.kun.springsecurity.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author zhoukun
 * @Date 2021/2/15 16:36
 */
@Controller
@Slf4j
public class LoginController {

//    @PostMapping ("/login/form")
//    public void loginFrom(){
//       log.info("========>{}执行了登录请求");
//    }

    /**
     * 登陆成功后
     * @return
     */
    @PostMapping("/toMain")
    public String toMain(){
        //     return "main";
       return "redirect:/main";
    }

    @GetMapping("/toLogin")
    public String toLogin(){
        //     return "login";
      return "redirect:/main";
    }

    /*
    自定义404
     */

    @GetMapping("/404.html")
    public String html404()
    {
        return "redirect:https://www.bilibili.com/error";
    }

}
